<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>news-all</artifactId>
		<groupId>br.com.news</groupId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>

	<artifactId>news-factory</artifactId>

	<name>news-factory</name>
	<url>http://maven.apache.org</url>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<main.class>br.com.news.factory.NewsMain</main.class>
	</properties>

	<dependencies>
		<!-- NEWS UTILS -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>news-utils</artifactId>
		</dependency>
		
		<!-- WPATTERN NORTHWIND BUSINESS -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>news-business</artifactId>
		</dependency>

		<!-- WPATTERN NORTHWIND DATABASE -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>news-database</artifactId>
		</dependency>

		<!-- WPATTERN NORTHWIND SERVICE -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>news-service</artifactId>
		</dependency>

	</dependencies>
	
	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.xml</include>
				</includes>
				<filtering>true</filtering>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<shadedArtifactAttached>true</shadedArtifactAttached>
							<shadedClassifierName>news</shadedClassifierName>
							<shadedArtifactId>news</shadedArtifactId>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<finalName>news-server-${version}</finalName>
					<transformers>
						<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
							<resource>META-INF/spring.handlers</resource>
						</transformer>
						<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
							<resource>META-INF/spring.schemas</resource>
						</transformer>
						<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<manifestEntries>
								<Main-Class>${main.class}</Main-Class>
							</manifestEntries>
						</transformer>
					</transformers>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
